package com.factory.controller;

import com.factory.domain.deviceTable;
import com.factory.http.AjaxResult;
import com.factory.service.IDeviceTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.factory.http.AjaxResult.success;

/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2025-04-09
 */
@RestController
@RequestMapping("/device/table")
public class DeviceTableController {
    @Autowired
    private IDeviceTableService deviceTableService;
    /**
     * 新增保存【请填写功能名称】
     */
    @PostMapping("/add")
    public AjaxResult add(deviceTable device) {
        return success(deviceTableService.insertDeviceTable(device));
    }
    /**
     * 根据系统、设备查询报警值
     */
    @GetMapping("/DeviceQuery")
    public AjaxResult systemDeviceQuery(Long systemId, Long deviceId) {
        deviceTable deviceTable=deviceTableService.selectDeviceTableById(systemId,deviceId);
        return success(deviceTable);
    }
}
